UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BuGdo9OnrB7t8NBTxCxdXOIpO/dS2WFOP5xaOu39Y6w='
WHERE
key_id = '2914d661079efaf1178c232fbcfe78ca2ee26751664c15d4336e9add41f66c61'
AND (
token = 'BuGdo9OnrB7t8NBTxCxdXOIpO/dS2WFOP5xaOu39Y6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)