UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fSbUq7WRNDW4+WkgMn0oqggUHR1QIZ2iWSsYz8lVnl8=' 
WHERE 
  key_id = '16f50eb314cef0ef31569046cfbdae2091813244dff4a03828f1c97207e627dd' 
  AND (
    token = 'fSbUq7WRNDW4+WkgMn0oqggUHR1QIZ2iWSsYz8lVnl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030