UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mZnxeXBf1i9F5fSxlQ5hLedgBQ/kWEZXKU5F9FKfSA8=' 
WHERE 
  key_id = 'b3a7e333b0a1c3b2cb6f76d685de69571ddfc03d4fcb777b1460f107257a9547' 
  AND (
    token = 'mZnxeXBf1i9F5fSxlQ5hLedgBQ/kWEZXKU5F9FKfSA8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045