UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yl0xNcU3pL94nUow8vZPUJ5rv9U51fAqLJ7UER4CaXI=' 
WHERE 
  key_id = '6143098876b975c2a90bcddb73d2b527a42d429570ffb02c460b4c49ff5d7613' 
  AND (
    token = 'Yl0xNcU3pL94nUow8vZPUJ5rv9U51fAqLJ7UER4CaXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044