UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/U+N0mb5Bes0/hrwzrJnLWxT1VH2lIox9uyFO/BYwK0='
WHERE
key_id = 'b51853612f5e6f7078f6b13b1e7ce12cf07a86fd73820f38fba8c1d046a159a2'
AND (
token = '/U+N0mb5Bes0/hrwzrJnLWxT1VH2lIox9uyFO/BYwK0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)