UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0eE3DIk6TGBMNSb+ek/IEEwvwNhDW70sLZ5gw36L3GQ='
WHERE
key_id = 'c43e9876c21ba5167ab63c52c7331b343881fbaf86e228cc634087881f1db93c'
AND (
token = '0eE3DIk6TGBMNSb+ek/IEEwvwNhDW70sLZ5gw36L3GQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)