UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q5bchtzAeqwfYklPCmzemc4E2otze7RNM/aR4z183d4='
WHERE
key_id = 'b3903156b62b0d5884813e8e0e0528396d88dc6e831c08c214ef9ac07f8ea3c9'
AND (
token = 'q5bchtzAeqwfYklPCmzemc4E2otze7RNM/aR4z183d4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)