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