UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mNdcuUJXjxoIPFdBZLD33p/oVTbihwDSwAlTuCXzNM0=' 
WHERE 
  key_id = '5a641c91b88d68e0a5c7643f67a636473fc1adb83ba2df621d8504e8e9c102c9' 
  AND (
    token = 'mNdcuUJXjxoIPFdBZLD33p/oVTbihwDSwAlTuCXzNM0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033