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

Query time 0.00041