UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SDXIbtkNa3BDxlVyCqO2lacw22VFChV/3Sf1JP8hds8='
WHERE
key_id = '6accfc9372dbc0d7dcd1925a4dbd4579683fd45da6a347cd9e2c9bdcc7297d7e'
AND (
token = 'SDXIbtkNa3BDxlVyCqO2lacw22VFChV/3Sf1JP8hds8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)