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

Query time 0.00016