UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mo7AIamwc9lAfDGLCIFgfhpHHqYOIKVYVdcSBxt0TVU=' 
WHERE 
  key_id = 'f23c2247b5bb6f3b880bc3dff0bd4cda39ff87f6e6fb86510121759d975d3445' 
  AND (
    token = 'Mo7AIamwc9lAfDGLCIFgfhpHHqYOIKVYVdcSBxt0TVU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072