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