UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VFqkgBq44D2umnILri4BOKG68ExyNvuC/kAQnNdmdm0=' 
WHERE 
  key_id = '228d9628f078db1cde39258b03f9c34e0aa3562741c40a4a906dab043f73e4cd' 
  AND (
    token = 'VFqkgBq44D2umnILri4BOKG68ExyNvuC/kAQnNdmdm0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037