UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FmsobsYnBpGNdNFFXgGDt3PWTrdtPlSli+v+IuSJ/H8='
WHERE
key_id = '9d805713012afdb2cf80287bc018447fac53a7a369b9b844ceed8362162bf11f'
AND (
token = 'FmsobsYnBpGNdNFFXgGDt3PWTrdtPlSli+v+IuSJ/H8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)