UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n+V3+PjzKMpbPePI5Jxk6nLQvC6YgkKDCHolM3BZoCU='
WHERE
key_id = 'cbde08bd18b8a8ea68d99a05808fa8273972ed420c0e8e534f4f5b830dab9496'
AND (
token = 'n+V3+PjzKMpbPePI5Jxk6nLQvC6YgkKDCHolM3BZoCU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)