UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zVXxGnuzvP6lGsJ3EzbuOO85/37yQStWDzcrntmB18U=' 
WHERE 
  key_id = '47f28fa732bc9a97f7b00c12f8e3f0db15d60b33e42d485d11c9cb4b6a45198e' 
  AND (
    token = 'zVXxGnuzvP6lGsJ3EzbuOO85/37yQStWDzcrntmB18U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025