UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ftvayhGa74AMGqRUDM5qztVPTjv8Qx0vf2CDs+WTP4M='
WHERE
key_id = 'eff2e6de66ef7280e683fcc83e0ddda87e1cb2893f067838cbfd99858940a993'
AND (
token = 'ftvayhGa74AMGqRUDM5qztVPTjv8Qx0vf2CDs+WTP4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)