UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PPnXVxsaVTOPeV2YtmSQ5ThyDUZdmJ69O73CHRLO2Rs='
WHERE
key_id = '23f1706bd6bb53eaa2dde76a70b6c9e87ede7465ba5d1880e6861b99cb64d895'
AND (
token = 'PPnXVxsaVTOPeV2YtmSQ5ThyDUZdmJ69O73CHRLO2Rs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)