UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7LxiDiGXPFp0h9sjXuSfnYYsclCxyB9ntGNOlKsJROE=' 
WHERE 
  key_id = '81c1252799e203281e8c2e6ea20be5c9b1c58d26a9a8a95bfdedc3312037b76e' 
  AND (
    token = '7LxiDiGXPFp0h9sjXuSfnYYsclCxyB9ntGNOlKsJROE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033