UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z1QTKgmfkpdvcyrMxMsRh8eHWgZcaqvG3rS6qZ0FzpY=' 
WHERE 
  key_id = '2646f75fe71dc39cc4318e4335022b35728ca437e20400322b309678a8c7e1b6' 
  AND (
    token = 'Z1QTKgmfkpdvcyrMxMsRh8eHWgZcaqvG3rS6qZ0FzpY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029