UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UkOp1cpDLRYXRYVVyxhD8JyjXGNz6wf8wnGzQhvnS0o=' 
WHERE 
  key_id = 'faea6beeca23e2e53de62650247f855ff8e55b8aabfc8f1b0f1818dfd4a27de1' 
  AND (
    token = 'UkOp1cpDLRYXRYVVyxhD8JyjXGNz6wf8wnGzQhvnS0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049