UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f1pnF3CF36POouBLu2etFbRlMgbCq4bS1ItRQXFW1Z0='
WHERE
key_id = '91eb925a9252f62d396f4c00773f10a26696cd33adb84454e0bdbef34bf30c30'
AND (
token = 'f1pnF3CF36POouBLu2etFbRlMgbCq4bS1ItRQXFW1Z0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)