UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's1ed5Zw6TPW1Uu8w88xgaltmyxal2i+0sTbdFIxan/o='
WHERE
key_id = '4dbafaa95bc29da49332a58a1ffee47e400f84a8e67e169deea8473c739c04a1'
AND (
token = 's1ed5Zw6TPW1Uu8w88xgaltmyxal2i+0sTbdFIxan/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)