UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XFbtHAFRoO2SqxKikx3TTEX4tWcdOCfwsDRsJBd0BcA='
WHERE
key_id = '1da9106789e96a4793a7fa3ff3a20f3d23749a8b56161670dfe5ac4397f670da'
AND (
token = 'XFbtHAFRoO2SqxKikx3TTEX4tWcdOCfwsDRsJBd0BcA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)