UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4+EwuHuzTR3HB4VMJ9hcLAWEyFpfX7oXVQeMs2qzmSI='
WHERE
key_id = '5a083db85f9485e3c9ece1d47e861b0656330b1f8a0e244ac65532b98b4d5116'
AND (
token = '4+EwuHuzTR3HB4VMJ9hcLAWEyFpfX7oXVQeMs2qzmSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)