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