UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9I7w2l2m4VmRB/h3zCia0Y2IYSyW3ceerT7XDcBWoRM=' 
WHERE 
  key_id = '8ff572b78e6e8c590e58065e6a35dc9234311425198cb67c85b196e594bc320e' 
  AND (
    token = '9I7w2l2m4VmRB/h3zCia0Y2IYSyW3ceerT7XDcBWoRM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026