UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eOPv1K4iRlUUsmPe29D3lqnW38YalHXOeF4KLFXUXdI=' 
WHERE 
  key_id = '3b8b077d62c72aea63c57fca1368e76e2381241b7f4b9f8f4b9fc8f8ca7dd5df' 
  AND (
    token = 'eOPv1K4iRlUUsmPe29D3lqnW38YalHXOeF4KLFXUXdI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034