UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ojRv/pZlDXyD5NIBSvI2xZ5QGOgOvZpF7s5S0ZND8LM='
WHERE
key_id = '83c9dccee6d51dead319992394883e7510eb662cc3382a7500592f4b8f4b7197'
AND (
token = 'ojRv/pZlDXyD5NIBSvI2xZ5QGOgOvZpF7s5S0ZND8LM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)