UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lld2eRUNkp4/FzHoYUkdJJW5pVQVwQ5MgLIJ2HIeSQY=' 
WHERE 
  key_id = 'e41d9418c65716c91f48d1558b3e6e23d2130ab097d95bb38657e2174c3fbcf8' 
  AND (
    token = 'lld2eRUNkp4/FzHoYUkdJJW5pVQVwQ5MgLIJ2HIeSQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036