UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's2eWSvgR9lFABH7/Jx5HdYFB5x1IqAUp441Ox2k3iDQ='
WHERE
key_id = '5170830dc9934ce12b85cfc6381e9a83544a3717c57501c6995a61b22ec45459'
AND (
token = 's2eWSvgR9lFABH7/Jx5HdYFB5x1IqAUp441Ox2k3iDQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)