UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ex7EmmFraUUQ2MUHbS2sY/h5p/QNU+1Fc6aCk/+AEX4='
WHERE
key_id = '9f86ab83ae7286733f03bedfd9e20f11a2db2c1e12387c391c579e4250664aff'
AND (
token = 'ex7EmmFraUUQ2MUHbS2sY/h5p/QNU+1Fc6aCk/+AEX4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)