UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BVAyK/m5gaMCoVDRTx5nzI9jyToYn0FsE0ILn/g3/jI='
WHERE
key_id = '0472839a9c0f3db2e71c1106c300710b7d22f554749f3e650f0d648426ab2827'
AND (
token = 'BVAyK/m5gaMCoVDRTx5nzI9jyToYn0FsE0ILn/g3/jI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)