UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/k0TdT0i/T1bjaerjUmG/0zZ5Qv23R21RmvpotsFMsw=' 
WHERE 
  key_id = '255101da427ca29d55a0eeb998617f5df902dbf7e673276f2d6035655d08cde5' 
  AND (
    token = '/k0TdT0i/T1bjaerjUmG/0zZ5Qv23R21RmvpotsFMsw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030