UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EZ/+ceqqRv490fr7gvjWTmEeA8U7E8un++okqPSLpCY=' 
WHERE 
  key_id = '40df02905f5766b9f87eda6846e02340f3c372a142206d18474fe8f02a17ead6' 
  AND (
    token = 'EZ/+ceqqRv490fr7gvjWTmEeA8U7E8un++okqPSLpCY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042