UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'isljcHGqIQUHXYMaVQP/abJFnPExI9A7APF4eGaq8oM='
WHERE
key_id = 'ce440535421146ceae5c885f541fd2160d60ed5054970dd9d8da0293769bfcec'
AND (
token = 'isljcHGqIQUHXYMaVQP/abJFnPExI9A7APF4eGaq8oM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)