UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T+PlfAKSPnnmZ/7aVIPH0CjAPM4SMozXqQgKAKPslQs='
WHERE
key_id = 'f46be3074e6a3e6a59e4a36483568e33011e6f4e317ad0ccd582a9c4f71ba1ed'
AND (
token = 'T+PlfAKSPnnmZ/7aVIPH0CjAPM4SMozXqQgKAKPslQs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)