UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qv1WaYUeQNaqQyew1lnGoYV2pEdMaPpzYCwpDpXkbiA='
WHERE
key_id = 'ded99132944fe4803cb882866663853c570c15f496c9f92124bdf88bd1ca195e'
AND (
token = 'Qv1WaYUeQNaqQyew1lnGoYV2pEdMaPpzYCwpDpXkbiA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)