UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M+Q/iaZhPZf2SN6zYCDAOFYcm8IG+0/9d3O8x3pS+FU=' 
WHERE 
  key_id = '3f51c531f314448bbe9a256170b7eefc651ed59778c4955282226620455b38fc' 
  AND (
    token = 'M+Q/iaZhPZf2SN6zYCDAOFYcm8IG+0/9d3O8x3pS+FU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039