UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FxV2ZN+4+fY4Q9/hP3GEOdU90Af4mQgJch78DYC1O38='
WHERE
key_id = '987b6bda9288e888086ab4f9b3fc3cbe20f2ad086d4610b770f69dcd6c55559d'
AND (
token = 'FxV2ZN+4+fY4Q9/hP3GEOdU90Af4mQgJch78DYC1O38='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)