UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8T61tccJsckWTM6erwK45xQ3vgTl9rux+AJpUywsFsc='
WHERE
key_id = '6c5bdab2abab6a269267c27d5caa0eb644c7298b53b744e5c2821e0f9246075e'
AND (
token = '8T61tccJsckWTM6erwK45xQ3vgTl9rux+AJpUywsFsc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)