UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eqo6j/mswa+04AOEzT0w+wBSzbImRtsNGlIsH5kq5sw='
WHERE
key_id = 'b484b0404057626f96d4ffc91e2547e9250da61d310d52cecef24ebaa7758fee'
AND (
token = 'eqo6j/mswa+04AOEzT0w+wBSzbImRtsNGlIsH5kq5sw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)