UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WG3JQH5jpVehr9wjgR2ieCGWoLn0t6rmSA8APJ7kHvw='
WHERE
key_id = '2118a4112d1c735d0a47fdd1d5c1689af59857492582b208896efb87805b802e'
AND (
token = 'WG3JQH5jpVehr9wjgR2ieCGWoLn0t6rmSA8APJ7kHvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)