UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F6QEJNKM/H9nj4pKpU1nxnXdvger4n0zmBRRH2xMeMQ=' 
WHERE 
  key_id = 'e42f31455f81aaeca324179fd77783a755e25153d6ff75a7da22b56975b3fb0f' 
  AND (
    token = 'F6QEJNKM/H9nj4pKpU1nxnXdvger4n0zmBRRH2xMeMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046