UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A4FDVrG9/IWM/xUU4ubdmg6w8DwjvBVOH46k62SdUvM='
WHERE
key_id = 'a10edde6f303221ee96acd9a211f83f1f96b5f0cab9f1ca31ea29f55cc148c5f'
AND (
token = 'A4FDVrG9/IWM/xUU4ubdmg6w8DwjvBVOH46k62SdUvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)