UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i/p4ppUiLvvBSPJs5fEa22JTGeEWdh+XeVr0RPM85hY='
WHERE
key_id = '5e58aa8b9e1bf5b1c038e7835701d0c4333a75e5fb817e1ac4f5745fe21edd1c'
AND (
token = 'i/p4ppUiLvvBSPJs5fEa22JTGeEWdh+XeVr0RPM85hY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)