UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd8ISO8wyObLkAHdYRdTZ5QfcjKeMAchiv6dCnultGHE=' 
WHERE 
  key_id = '2ee59e14bd5f6c41a33fb8c31eadc290daef31cf4b0f5f109e6f2dd7fd6ef489' 
  AND (
    token = 'd8ISO8wyObLkAHdYRdTZ5QfcjKeMAchiv6dCnultGHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030