UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ja2bwe/uzq4ibWQAgfCm5c5IohV/LOH2VE0jYo9M9Cw='
WHERE
key_id = '4900c5b3666feaf22e968bb4f7767c5a88b4a704de59db65aa4fd0bd48438e03'
AND (
token = 'Ja2bwe/uzq4ibWQAgfCm5c5IohV/LOH2VE0jYo9M9Cw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)