UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rwu2j2LU+lvYQhsOmfhiGPQfowyzsvGuRUqRNJyVDIk=' 
WHERE 
  key_id = '582600220d4dc7dbceb7ef490bc6b7cdfaee1bcbc7a399301dedd0679e099fcc' 
  AND (
    token = 'Rwu2j2LU+lvYQhsOmfhiGPQfowyzsvGuRUqRNJyVDIk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067