UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hysLV/tjlzmcts2InT7Wu2/ovlGZBTNa5Xv9m7Vw0LU=' 
WHERE 
  key_id = 'ec6818871750d7d5a9efeeac7a8bf4c036c949b89c13e158a2c170e2bb86d5ac' 
  AND (
    token = 'hysLV/tjlzmcts2InT7Wu2/ovlGZBTNa5Xv9m7Vw0LU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029